class BagsController < ApplicationController
  def index
    @count = Bag.number_of_empty_bags
  end
  
  def new
    @bag = Bag.new
  end
  
  def create
    @bag = Bag.new(params[:bag])
    quantity = @bag.quantity
    quantity.times do
      Bag.create!
    end
    redirect_to bags_path
  end
end
